#pragma once
#include "DirectoryEntry.h"
#include "DirectoryTree.h"

class DirectoryTree; // This line is put here to resolve a circular class reference.
/// <summary>
/// The idea is to keep track of the file and its directory.
/// </summary>
class DirectoryEntryWithTree
{
public:
	/// <summary>
	/// Compares all the folders except the grandparent folder.
	/// </summary>
	/// <param name="target">File to compare to</param>
	/// <returns>Returns true if these files are in the same folder. Doesn't check grandparent folder.</returns>
	bool AreFoldersTheSame(DirectoryEntryWithTree* target);
	/// <summary>
	/// The file, file size, and other file attributes.
	/// </summary>
	DirectoryEntry* File;
	/// <summary>
	/// The folder the file is in. 
	/// </summary>
	DirectoryTree* Folder;
	/// <summary>
	/// Compare the files in two trees.
	/// </summary>
	/// <param name="item1"></param>
	/// <param name="item2"></param>
	/// <returns></returns>
	static int CompareFiles(const DirectoryEntryWithTree* item1, const DirectoryEntryWithTree* item2);
};

